package net.jalisq.gen;

import net.jalisq.builder.joins.JoinType;
import net.jalisq.builder.joins.OnJoinType;
import net.jalisq.builder.joins.UsingJoinType;
import wulfUtils.io.IOUtil;

import wulfUtils.template.StringTemplate;



public class JoinCodeGen {

	
	public void generate(String sourceDir, String pack, String classname) throws Exception {
		StringTemplate st = 
			StringTemplate.loadTemplate("wulfUtils.linq.gen.template.joiner", "jav", "%");
		
		st.put("plainJoins", JoinType.values());
		st.put("onJoins", OnJoinType.values());
		st.put("usingJoins", UsingJoinType.values());
		
		st.put("package", pack);
		st.put("classname", classname);
		
		IOUtil.write(sourceDir + "/" + pack.replace(".", "/"), classname + ".java", st.fillTemplate());
		
		
		
		
	}
}
